<?php
class KenDon{

  // <<method:load>>
    public static function load($targetName,  $type='core',  $suffix='.php' ){

      if($type == 'core' && class_exists($targetName) == true){ return true;}


      //欲加载文件的路径
      $path = '';

      //*
      switch($type){
        case 'core':
          $path   =  KD_ClassesPath.KDDS.'KD_'.$targetName.$suffix; 
          break;

        //库
        case 'lib':
          $path   =  KD_LibPath.KDDS.$targetName.$suffix;
          break;

        //API
        case 'api':
          $path   =  KD_APIPath.KDDS.'KD_I' .$targetName .$suffix;
          break;

        //适配器
        case 'adapter':
          $path   =  KD_AdapterPath.KDDS.'KD_Adapter_'.$targetName.$suffix;
          break;
        }
       //*/

      if( file_exists($path) ){
        require_once $path;
        return true;
      }else{
        return false;
      }
    }
  // -- end -- <<method:load>>
}
